<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <?php
    if (!isset($_SESSION))
        session_start();
    require('../../Smarty/libs/Smarty.class.php');

    $smarty = new Smarty;

    $smarty->setTemplateDir('./smarty/templates/');
    $smarty->setCompileDir('./smarty/templates_c/');
    $smarty->setConfigDir('./smarty/configs/');
    $smarty->setCacheDir('./smarty/cache/');

    if (empty($_SESSION['logged_bool'])) {
        $_SESSION['logged_bool'] = false;
    }
    $status = $_SESSION['logged_bool'];
    
    if(!empty($_SESSION['searchError'])){
        $smarty->assign("error", $_SESSION['searchError']);
        unset($_SESSION['searchError']);
    }
    $smarty->assign("logged", $status);
   
    if(isset($_SESSION['book_guard']['postcontents']['currentPage'])) {
        $smarty->assign("currentPage", $_SESSION['book_guard']['postcontents']['currentPage']);
    }

    $smarty->display('preHeader.tpl');
    echo '<body>';
    $smarty->display('header.tpl');
    $smarty->display('error.tpl');
    $smarty->display('flashyBox.tpl');
    $smarty->display('footer.tpl');
    echo '</body>';
    ?>
</html>